﻿using FoodModel;
using J.FoodManageGet.Application.Command.TasteCommand;
using J.FoodRepository.InterFace;
using MediatR;

namespace J.FoodManageGet.Application.CommandHandler.TasteCommandHandler
{
    /// <summary>
    /// 口味反填
    /// </summary>
    public class TasteBackCommandHandler : IRequestHandler<TasteBackCommand, List<TasteModel>>
    {
        private readonly ITasteRepository _tasteRepository;

        public TasteBackCommandHandler(ITasteRepository tasteRepository)
        {
            _tasteRepository = tasteRepository;
        }
        public async Task<List<TasteModel>> Handle(TasteBackCommand request, CancellationToken cancellationToken)
        {
            var list = await _tasteRepository.TasteBack(request.TasteId);
            return list;
        }
    }
}
